<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>上海泛软科技有限公司-后台登陆</title>
<meta name="robots" content="nofollow" />
<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>
<link href="/Public/Css/admin-style.css" rel="stylesheet" type="text/css" />
<link href="/Public/Css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/Public/Css/bootstrap.min.css" rel="stylesheet" type="text/css" />


<script language="javascript" type="text/javascript" src="/Public/Js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/admin-common.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/bootstrap.min.js"></script>
<!--<script language="javascript" type="text/javascript" src="/Public/Js/bootstrap.js"></script> -->
<script language="javascript" type="text/javascript" src="/Public/Js/rock_customer_list.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/demo.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/blob.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/FileSaver.min.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/jquery.base64.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/jquery-1.10.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/tableExport.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/xlsx.core.min.js"></script>
</head>

<body>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
	<style type="text/css">
		body, html {width: 100%;height: 100%;margin:0;font-family:"微软雅黑";}
		#allmap{width:80%;height:100%;float:left}
		#content{
		   width:100%;height:100%;margin:0px;
		}
		#comment{
		  background:#FFFACD; width:20%;height:100%;float:left;
		  
		}
		#dingwei{
		  position:fixed;
          left:5px;
          top:80px;
		  z-index:0;
		  margin-left:35%;
		  border:1px solid black;
		}
		.bili{
		  background:white;
		  text-align:center;
		  float:left;
		  width:80px;
		  height:30px;
		  line-height:30px;
		  color:black;
		  
		}
	ul li{
		 list-style:none
		}
	#dingwei_info{
		  position:fixed;
          left:0px;
          top:0px;
		  z-index:1;
		  width:80%;
		  background:#FCFCFC;
		}
	.device{
	   
	   margin-right:20px;
	   margin-left:20px;
	
	}	
	.temperature_alarm{
	 
	  margin-right:20px;
	  
	}
	.cancle_alarm{
	   
	  
	}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xyuLwhENsN5FHzG0sVIWIWVmrjALXxi3"></script>
<title>体温地图</title>
</head>
<body>
   <div id="content" >
	 <div id="allmap">  
	 </div>
	 <div id="comment" style="padding:29px">
	   <h4 style="font-weight:bold;">设备故障</h4>
	   <ul class="list">
	  <!--  <?php if(is_array($device_num)): $i = 0; $__LIST__ = $device_num;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$device): $mod = ($i % 2 );++$i;?>-->
		 <!-- <li class="device_guzhang"><?php echo ($device[0]); ?><span>、<?php echo ($device["city"]); ?></span><p>故障设备:<?php echo ($device["cou"]); ?></p></li> -->
	 <!--<?php endforeach; endif; else: echo "" ;endif; ?> -->
       </ul>
	   <a id="device_more" onclick="device_more()">查看更多</a>
	   
	    <h4 style="font-weight:bold;">高温警告</h4>
	   <ul class="list1">
       </ul>
	   <a id="temper_more" onclick="temper_more()">查看更多</a>
	   <h4 style="font-weight:bold;">取消报警</h4>
	   <ul class="list2">
	  
       </ul>
	   <a id="cancel_more" onclick="cancel_more()">查看更多</a>
	 </div>
   </div>
    <div id="dingwei_info">
	  <div class="device" style="width:30%;float:left;">
	     <table style="width:100%;">
		   <tr style="width:100%;background:#FFB90F;">
		     <td><span style="visibility:hidden">xx</span><img  src="http://120.25.75.20/zheds/images/test.png" style="height:25%"></td>
			 <td style="text-align:center">
			    <span id="device_number_guzhang_BAK" style="color:white;font-size:20px">0/1</span></br>
				<span style="color:white">设备故障</span>
			 </td>
		   </tr>
		   <tr style="width:100%;background:#E8E8E8" id="device_detail">
		     <td><a style="color:black" href="<?php echo U('Wenlian/equipment_Alarm');?>">查看详情</a></td>
			 <td style="text-align:right">></td>
		   </tr>
		 </table>
	  </div>
	  <div class="temperature_alarm" style="width:30%;float:left">
	     <table style="width:100%">
		   <tr style="width:100%;background:#EE2C2C">
		     <td><span style="visibility:hidden">xx</span><img src="http://120.25.75.20/zheds/images/test.png" style="height:25%"></td>
			 <td style="text-align:center">
			    <span style="color:white;font-size:20px" id="tem_BAK">3</span></br>
				<span style="color:white">高温警告</span>
			 </td>
		   </tr>
		   <tr style="width:100%;background:#E8E8E8"  onclick="high_TempAlarm_detail()">
		     <td><a style="color:black" href="<?php echo U('Wenlian/temperature_Alarm');?>">查看详情</a></td>
			 <td style="text-align:right">></td>
		   </tr>
		 </table>
	    
	  </div>
	  <div class="cancle_alarm" style="width:30%;float:left">
	    <table style="width:100%">
		   <tr style="width:100%;background:#ff7f00">
		     <td><span style="visibility:hidden">xx</span><img src="http://120.25.75.20/zheds/images/test.png" style="height:25%"></td>
			 <td style="text-align:center">
			    <span id="can_num_BAK" style="color:white;font-size:20px">1</span></br>
				<span style="color:white">医院数据警告</span>
			 </td>
		   </tr>
		   <tr style="width:100%;background:#E8E8E8" onclick="cancel_alarm_detail()">
		     <td><a style="color:black" href="<?php echo U('Wenlian/hospital_Map');?>">查看详情</a></td>
			 <td style="text-align:right">></td>
		   </tr>
		 </table>
	  </div>
   </div> 
   <div id="dingwei">
	  <div class="bili">比例</div>
	  <div class="bili" style="background:#3c80ff; color:white">实时</div>
   </div> 
  <?php if(is_array($hospitalData)): $i = 0; $__LIST__ = $hospitalData;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><h5 class="listValue" zhengchang = '<?php echo ($list["zhengchang"]); ?>'  piangao='<?php echo ($list["piangao"]); ?>' gaowen = '<?php echo ($list["gaowen"]); ?>'  sum='<?php echo ($list["sum"]); ?>' name='<?php echo ($list["h_province"]); ?>' lng='<?php echo ($list["h_address_x"]); ?>' lat='<?php echo ($list["h_address_y"]); ?>'></h5><?php endforeach; endif; else: echo "" ;endif; ?>	
  <?php if(is_array($city)): $i = 0; $__LIST__ = $city;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$city): $mod = ($i % 2 );++$i;?><h5 class="city" zhengchang = '<?php echo ($city["zhengchang"]); ?>'  piangao='<?php echo ($city["piangao"]); ?>' gaowen = '<?php echo ($city["gaowen"]); ?>'  sum='<?php echo ($city["sum"]); ?>' name='<?php echo ($city["h_name"]); ?>' lng='<?php echo ($city["h_address_x"]); ?>' lat='<?php echo ($city["h_address_y"]); ?>'></h5><?php endforeach; endif; else: echo "" ;endif; ?>	
</body>
</html>
<script type="text/javascript">
    device_data(0);//初始的设备数量
	tempAlarm();//高温警告
	temp_data(0);//高温警告详细
	cancel_alarm(0);//取消报警
    funl();
	localStorage.flag == 0
	var mp = new BMap.Map("allmap", {  
        minZoom : 5,  
        maxZoom : 18  
    }); 	
    mp.centerAndZoom(new BMap.Point(116.3964,39.9093), 4);//5-7级全国 “省”  7-12 “市” 13-18 “街道”
	var geolocation = new BMap.Geolocation();
	geolocation.getCurrentPosition(function(r){
		if(this.getStatus() == BMAP_STATUS_SUCCESS){
			var mk = new BMap.Marker(r.point);
			mp.addOverlay(mk);
			mp.panTo(r.point);
		    //////
		  }
		else {
			alert('failed'+this.getStatus());
		}        
	},{enableHighAccuracy: true})
  function funl(){
  $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/temperature_ProvinceMap',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
	    },
 	     success: function(data){
           for(var i =0; i <data.length; i++){
		        var name = data[i]["h_province"];//$(".listValue").eq(i).attr("name"); 
				var lng  = data[i]["h_address_x"];//$(".listValue").eq(i).attr("lng"); 
				var lat  = data[i]["h_address_y"];//$(".listValue").eq(i).attr("lat");
				var sum  = data[i]["sum"];//$(".listValue").eq(i).attr("sum");
				var gaowen  = data[i]["gaowen"];//$(".listValue").eq(i).attr("gaowen");
				var piangao  = data[i]["piangao"];//$(".listValue").eq(i).attr("piangao");
				var zhengchang  = data[i]["zhengchang"];//$(".listValue").eq(i).attr("zhengchang");
				if(!gaowen){
					 data[i]["gaowen"]="暂无高温";
				}
				if(!piangao){
					 data[i]["piangao"]="暂无偏高";
				}
				if(!zhengchang){
					data[i]["zhengchang"]="暂无正常";
				}
		   }
            addtext(data);		   
		 }
	   });
  }
  function fun1(){
	$.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/temperature_CityMap',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		   //str:string
		 },
 	     success: function(data){
		   var s = JSON.stringify(data);
           for(var i =0; i <data.length; i++){
		        var name = data[i]["h_name"];//$(".listValue").eq(i).attr("name"); 
				var lng  = data[i]["h_address_x"];//$(".listValue").eq(i).attr("lng"); 
				var lat  = data[i]["h_address_y"];//$(".listValue").eq(i).attr("lat");
				var sum  = data[i]["sum"];//$(".listValue").eq(i).attr("sum");
				var gaowen  = data[i]["gaowen"];//$(".listValue").eq(i).attr("gaowen");
				var piangao  = data[i]["piangao"];//$(".listValue").eq(i).attr("piangao");
				var zhengchang  = data[i]["zhengchang"];//$(".listValue").eq(i).attr("zhengchang");
				if(!gaowen){
					 data[i]["gaowen"]="暂无高温";
				}
				if(!piangao){
					 data[i]["piangao"]="暂无偏高";
				}
				if(!zhengchang){
					data[i]["zhengchang"]="暂无正常";
				}
		   }
            addtext(data);	
		 }
	   });
  }
  function fun2(){
  $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/temperature_Map_Data',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		   //str:string
		 },
 	     success: function(data){
		   addText1(data);
		 }
	   });
  }
   function fun3(){
  $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/temperature_Map_CityData',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		   //str:string
		 },
 	      success: function(data){
		   addText1(data);
		 }
	   });
  }  //addText(lng,lat,name,number,gaowen);	
  function addtext(data){
   mp.enableScrollWheelZoom();
	 var allOverlay = mp.getOverlays();
	 if(allOverlay.length >= 1){
	   debugger;
	  for (var i = 0; i < allOverlay.length ; i++)
       {            
          mp.removeOverlay(allOverlay[i]);
       }
	 }
   // 复杂的自定义覆盖物
	function ComplexCustomOverlay(point, text, mouseoverText){
	this._point = point;
	this._text = text;
	this._overText = mouseoverText;
	}
	ComplexCustomOverlay.prototype = new BMap.Overlay();
	ComplexCustomOverlay.prototype.initialize = function(map){
		this._map = map;
		var div = this._div = document.createElement("div");
		div.style.position = "absolute";
		div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
		div.style.background = "#FF7F00";//url(blue.gif) repeat-x 0 -33px
		div.style.color = "white";
		div.style.height = "21px";
		div.style.padding = "2px";
		div.style.lineHeight = "18px";
		div.style.whiteSpace = "nowrap";
		div.style.MozUserSelect = "none";
		div.style.fontSize = "12px";
		div.style.cursor = "pointer";
		var span = this._span = document.createElement("span");
		div.appendChild(span);
		span.appendChild(document.createTextNode(this._text));
		var that = this;
		 
		var arrow = this._arrow = document.createElement("div");
		//arrow.style.background = "url(blue.gif) no-repeat -8px -100px";
		arrow.style.position = "absolute";
		arrow.style.width = "30px";
		arrow.style.height = "12px";
		arrow.style.top = "19px";
		arrow.style.left = "10px";
		arrow.style.overflow = "hidden";
		div.appendChild(arrow);
		var leftBar = this._leftBar = document.createElement("div");
		//leftBar.style.background = "url(blue.gif) no-repeat -12px -2px";
		leftBar.style.position = "absolute";
		leftBar.style.width = "11px";
		leftBar.style.height = "24px";
		leftBar.style.top = "0px";
		leftBar.style.left = "-10px";
		leftBar.style.overflow = "hidden";
		div.appendChild(leftBar);
		 
		var rightBar = this._rightBar = document.createElement("div");
		//rightBar.style.background = "green";//url(blue.gif) no-repeat -22px -2px
		rightBar.style.position = "absolute";
		rightBar.style.width = "11px";
		rightBar.style.height = "24px";
		rightBar.style.top = "0px";
		rightBar.style.right = "-10px";
		rightBar.style.overflow = "hidden";
		div.appendChild(rightBar);
		div.onmouseover = function(){
		this.style.background = "#FF7F00";//url(blue2.gif) repeat-x 0 -33px
		this.getElementsByTagName("span")[0].innerHTML = that._overText;
		//arrow.style.background = "url(blue2.gif) no-repeat -8px -100px";
		//leftBar.style.background = "url(blue2.gif) no-repeat -12px -2px";
		//rightBar.style.background = "url(blue2.gif) no-repeat -22px -2px";
		}
		 
		div.onmouseout = function(){
		this.style.background = "#FF7F00";//url(blue.gif) repeat-x 0 -33px
		this.getElementsByTagName("span")[0].innerHTML = that._text;
		//arrow.style.background = "url(blue.gif) no-repeat -8px -100px";
		//leftBar.style.background = "url(blue.gif) no-repeat -12px -2px";
		//rightBar.style.background = "url(blue.gif) no-repeat -22px -2px";
		}
		 
		mp.getPanes().labelPane.appendChild(div);
		return div;
	}
	ComplexCustomOverlay.prototype.draw = function(){
		var map = this._map;
		var pixel = map.pointToOverlayPixel(this._point);
		this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
		this._div.style.top = pixel.y - 30 + "px";
	}
	ComplexCustomOverlay.prototype.addEventListener = function(event,fun){
	    this._div['on'+event] = fun;
	}
	var markerArr = data
	function createInfoWindow(i){
	  var json = markerArr[i];
	  var name = '';
	  if(!json["h_province"] ){
	      name= json["h_name"]
	  }else{
	    name= json["h_province"];
	  } 
	    var iw = new BMap.InfoWindow("<b title='\' + json.title + '>" + name+":</b><span>采样数:"+json["sum"]+"</span><br/><span>高温:"+json["gaowen"]+"</span><br/><span>偏高:"+json["piangao"]+"</span><br/><span>正常:"+json["zhengchang"]+"</span>");
	   return iw;
	}
	for(var i = 0; i < markerArr.length; i++) {
		var json=markerArr[i]
		var txt = markerArr[i]["gaowen"];
		var pintx = markerArr[i]["h_address_x"];//markerArr[i].point.split('|')[0];
		var pinty = markerArr[i]["h_address_y"];//markerArr[i].point.split('|')[1];
		var myCompOverlay=new ComplexCustomOverlay(new BMap.Point(pintx, pinty), txt, txt); //这步是将覆盖物存到变量，以便下面使用。
		 mp.addOverlay(myCompOverlay);
		debugger;
	 (function(){
		var index = i;
		var p0 = markerArr[i]["h_address_x"];//json.point.split("|")[0];
		var p1 = markerArr[i]["h_address_y"];//json.point.split("|")[1];
		var point = new BMap.Point(p0,p1);
		var _iw = createInfoWindow(i);
		var _marker = myCompOverlay; //当初存的覆盖物变量，这里派上用场了。
		_marker.addEventListener("click",function(e){
		   mp.openInfoWindow(_iw,point);
		});
		 if(!!json.isOpen){
			this.openInfoWindow(_iw);
		  }
	  })()
	}
// } 
}
function addText1(data){
   mp.enableScrollWheelZoom();
	 var allOverlay = mp.getOverlays();
	 if(allOverlay.length >= 1){
	  for (var i = 0; i < allOverlay.length ; i++)
       {            
          mp.removeOverlay(allOverlay[i]);
       }
	 }
   // 复杂的自定义覆盖物
	function ComplexCustomOverlay(point, text, mouseoverText){
	this._point = point;
	this._text = text;
	this._overText = mouseoverText;
	}
	ComplexCustomOverlay.prototype = new BMap.Overlay();
	ComplexCustomOverlay.prototype.initialize = function(map){
		this._map = map;
		var div = this._div = document.createElement("div");
		div.style.position = "absolute";
		div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
		div.style.background = "#FF7F00";//url(blue.gif) repeat-x 0 -33px
		div.style.color = "white";
		div.style.height = "21px";
		div.style.padding = "2px";
		div.style.lineHeight = "18px";
		div.style.whiteSpace = "nowrap";
		div.style.MozUserSelect = "none";
		div.style.fontSize = "12px";
		div.style.cursor = "pointer";
		var span = this._span = document.createElement("span");
		div.appendChild(span);
		span.appendChild(document.createTextNode(this._text));
		var that = this;
		 
		var arrow = this._arrow = document.createElement("div");
		//arrow.style.background = "url(blue.gif) no-repeat -8px -100px";
		arrow.style.position = "absolute";
		arrow.style.width = "30px";
		arrow.style.height = "12px";
		arrow.style.top = "19px";
		arrow.style.left = "10px";
		arrow.style.overflow = "hidden";
		div.appendChild(arrow);
		var leftBar = this._leftBar = document.createElement("div");
		//leftBar.style.background = "url(blue.gif) no-repeat -12px -2px";
		leftBar.style.position = "absolute";
		leftBar.style.width = "11px";
		leftBar.style.height = "24px";
		leftBar.style.top = "0px";
		leftBar.style.left = "-10px";
		leftBar.style.overflow = "hidden";
		div.appendChild(leftBar);
		 
		var rightBar = this._rightBar = document.createElement("div");
		//rightBar.style.background = "green";//url(blue.gif) no-repeat -22px -2px
		rightBar.style.position = "absolute";
		rightBar.style.width = "11px";
		rightBar.style.height = "24px";
		rightBar.style.top = "0px";
		rightBar.style.right = "-10px";
		rightBar.style.overflow = "hidden";
		div.appendChild(rightBar);
		div.onmouseover = function(){
		this.style.background = "#FF7F00";//url(blue2.gif) repeat-x 0 -33px
		this.getElementsByTagName("span")[0].innerHTML = that._overText;
		//arrow.style.background = "url(blue2.gif) no-repeat -8px -100px";
		//leftBar.style.background = "url(blue2.gif) no-repeat -12px -2px";
		//rightBar.style.background = "url(blue2.gif) no-repeat -22px -2px";
		}
		div.onmouseout = function(){
		this.style.background = "#FF7F00";//url(blue.gif) repeat-x 0 -33px
		this.getElementsByTagName("span")[0].innerHTML = that._text;
		//arrow.style.background = "url(blue.gif) no-repeat -8px -100px";
		//leftBar.style.background = "url(blue.gif) no-repeat -12px -2px";
		//rightBar.style.background = "url(blue.gif) no-repeat -22px -2px";
		}
		mp.getPanes().labelPane.appendChild(div);
		return div;
	}
	ComplexCustomOverlay.prototype.draw = function(){
		var map = this._map;
		var pixel = map.pointToOverlayPixel(this._point);
		this._div.style.left = pixel.x - parseInt(this._arrow.style.left) + "px";
		this._div.style.top = pixel.y - 30 + "px";
	}
	ComplexCustomOverlay.prototype.addEventListener = function(event,fun){
	    this._div['on'+event] = fun;
	}
	var markerArr = data
	function createInfoWindow(i){
	  var json = markerArr[i];
	  //var html = ""
	  var name = '';
	  if(!json["h_province"] ){
	      name= json["h_name"]
	  }else{
	    name= json["h_province"];
	  }
	    var iw = new BMap.InfoWindow("<b title='\' + json.title + '>" + name+ "</b><hr/><p>采样数:"+json["sum"]+"</p><p>高温:"+json["gaowen"]+"</p><p>偏高:"+json["piangao"]+"</p><p>正常:"+json["zhengchang"]+"</p>");
	   return iw;
	}
	for(var i = 0; i < markerArr.length; i++) {
		var json=markerArr[i]
		var pintx = markerArr[i]["h_address_x"];//markerArr[i].point.split('|')[0];
		var pinty = markerArr[i]["h_address_y"];//markerArr[i].point.split('|')[1];
		var txt = "*"+markerArr[i]["t_temperature"];
		var myCompOverlay=new ComplexCustomOverlay(new BMap.Point(pintx, pinty), txt, txt); //这步是将覆盖物存到变量，以便下面使用。
		 mp.addOverlay(myCompOverlay);
	}
}  
   var time_shi = 0;//定时器id
 //比例实时按钮
   $(".bili").click(function(){
	  $(".bili").css("background","#3c80ff");
	  $(".bili").css("color","white");
	  $(this).css("background","white");
	  $(this).css("color","black");
   });
   if(localStorage.flag == 0){
	  $(".bili").eq(1).css("background","#3c80ff");
	  $(".bili").eq(1).css("color","white");
	  $(".bili").eq(0).css("background","white");
	  $(".bili").eq(0).css("color","black");
   }else{
     $(".bili").eq(0).css("background","white");
	 $(".bili").eq(0).css("color","black");
	 $(".bili").eq(1).css("background","#3c80ff");
	 $(".bili").eq(1).css("color","white");
   }
    // var timer1=window.setTimeout(function(){},1000);  //timer1->1 当前是第一个定时器
	var  x = 0;//0代表省级 1代表市级
   $(".bili").click(function(){
     if(x == 0){
	   var title = $(this).html();
       if(title == "比例"){
		 funl();
		 localStorage.flag = 0; //比例
		 clearInterval(time_shi);
	   }
	   if(title=="实时"){
	     clearInterval(time_shi);
	     fun2();
	     localStorage.flag = 1;//实时
         time_shi = setInterval("fun2()","5000");//		 
	   }
	 }else{
	     var title = $(this).html(); //time_shi1
		  if(title == "比例"){
			  fun1();
			  localStorage.flag = 0;
			  clearInterval(time_shi);
		   }
		  if(title=="实时"){
		      clearInterval(time_shi);
			  fun3();
		      localStorage.flag = 1;
			  time_shi = setInterval("fun3()","5000");//		 
		  }
	 }
	  
	});	 
	
 
  //鼠标滑轮事件
  	document.body.onmousewheel = function(event){
	 clearInterval(time_shi);
	//获取当前地图的级别5-7级全国 “省”  7-12 “市” 13-18 “街道”
	   var map_no = mp.getZoom();
		if(map_no >= 5 && map_no <= 9 ){
		  if(localStorage.flag == 0){
		     funl(); 
		   }else{
	         fun2();
		   }	
           x = 0;	
		 }
		if(map_no > 9 && map_no <= 18){
           x = 1;		
		   if(localStorage.flag == 0){
		        fun1();
		   }else{
		       fun3();
	      }
	  }
  };
  
  //故障设备
  function device_data(flag){
    $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/search_Device_Num',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		  biaozhe:flag
		 },
 	     success: function(data){
		 debugger;
		   var html='';
		   for(var i = 0; i < data.length; i++){
		     html+=
			  '<li class="device_guzhang">'+data[i][0]+'<span>、'+data[i]["city"]+'</span><p>故障设备:'+data[i]["cou"]+'</p></li>'
		   }
		   $(".list").html(html);
		   $("#device_number_guzhang").html(data[0][1]);
		 }
	  });
  }
  //高温警告--详细的
  function temp_data(flag){
    $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/high_Temperature_Alarm',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		  biaozhe:flag
		 },
 	     success: function(data){
		 debugger;
		   var html='';
		   for(var i = 0; i < data.length; i++){
		     html+=
			  '<li class="">'+data[i][1]+'<span>、'+data[i]["h_province"]+'</span><p>高温警告:'+data[i][0]+'</p></li>'
		   }
		   $(".list1").html(html);
		 }
	  });
  }
  //查看更多设备故障
  function device_more(){
    var name = $("#device_more").html();
	if(name == "查看更多"){
	  device_data(1);
	  $("#device_more").html("收起更多");
	}
	if(name == "收起更多"){
	  device_data(0);
	  $("#device_more").html("查看更多");
	}
  }
  $("#device_detail").click(function(){
    device_more();
  })
  //高温警告--全部的
  function tempAlarm(){
    $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/high_TempAlarm',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		 
		 },
 	     success: function(data){
		   $("#tem").html(data);
		 }
	  });
  }
  //查看更多
  function temper_more(){
     var name = $("#temper_more").html();
	if(name == "查看更多"){
	  temp_data(1);
	  $("#temper_more").html("收起更多");
	}
	if(name == "收起更多"){
	  temp_data(0);
	  $("#temper_more").html("查看更多");
	}
   }
   //高温警告查看详情
   function high_TempAlarm_detail(){
     temper_more();
   }
   
   //今日取消报警医院
  function cancel_alarm(biaozhe){
    $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/cancle_hospital',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		   flag:biaozhe
		 },
 	     success: function(data){
		 debugger;
		   var html='';
		  if(data.length==0){
		     html="暂无数据";
		  }else{
		     for(var i = 0; i < data.length; i++){
		       var cou = i+1;
			   //html+=
			  //'<li class="">'+cou+'<span>、'+data[i]["h_name"]+'恢复正常</span></li>'
		     }
		  }
		   $(".list2").html(html);
		   $("#can_num").html(data[0][0]);
		 }
	  });
  }
  //取消报警 --->查看详情
  function cancel_alarm_detail(){
     cancel_more();
  }
  //取消报警-->看更多
  function cancel_more(){
     var name = $("#cancel_more").html();
	if(name == "查看更多"){
	  //cancel_alarm(1);
	  $("#cancel_more").html("收起更多");
	}
	if(name == "收起更多"){
	  //cancel_alarm(0);
	  $("#cancel_more").html("查看更多");
	}
  }
</script>

</body>
</html>